import 'package:proj_sfv/domain/Video.dart';

class VideoVo {
   String videoId;
   String videoName;
   List<String> tags;
   String profileUrl;

   VideoVo(
     this.videoId,
     this.videoName,
     this.tags,
     this.profileUrl
  );

  factory VideoVo.fromJson(Map<String, dynamic> json) {
    var tagString = json['tags'] as String;
    List<String> tags = tagString.split("#");
    return VideoVo(
        json['videoId'],
        json['videoName'],
        tags,
        json['profileUrl']
    );
  }

  factory VideoVo.fromVideo(Video v) {
    return VideoVo(v.videoId, v.videoName, v.tags.split("#"), v.profileUrl);
  }

  VideoVo.test():videoId = "av1", videoName = "视频测试", tags = ['测试', '视频'], profileUrl = "https://gallery.flutter.cn/assets/packages/flutter_gal"
      "lery_assets/places/india_chettinad_produce.png";

  VideoVo.test1():videoId = "av2", videoName = "新的3测试", tags = ['测试', '视频'], profileUrl = "https://pica.zhimg.com/8"
      "0/v2-d733fd0241506c2d601ba6104c7a5cd9_720w.webp?source=1940ef5c";

  VideoVo.test2():videoId = "av2", videoName = "新的测3试", tags = ['测试', '视频'], profileUrl = "https://picx.zhimg.com/80/v2-d3ce020c9e8de1decb98c71c8b2"
      "afc7e_720w.webp?source=1940ef5c";
  VideoVo.test3():videoId = "av2", videoName = "新的1测试", tags = ['测试', '视频'], profileUrl = "https://picx.zhimg.com/80/v2-80fd17fe7ad1cc863479cb306bb976f6"
      "_720w.webp?source=1940ef5c";
  VideoVo.test4():videoId = "av2", videoName = "新的1测试", tags = ['测试', '视频'], profileUrl = "https://pic1.zhimg.com/80/v2-a42edfe634607d8734d6fd377ef55b14_"
      "720w.webp?source=1940ef5c";

  VideoVo.test5():videoId = "av2", videoName = "新的1测试1", tags = ['测试', '视频'], profileUrl = "https://pic1.zhimg.com/80/v2-7b34ad5889757f28fcf1ffd84e7dab06"
      "_720w.webp?source=1940ef5c";
}